#include <graphics.h>
#include <conio.h>
#include <stdio.h>
int main()
{

	float PI = 3.14;//圆周率
	initgraph(600, 600);//打开一个窗口
	setbkcolor(RGB(128, 128, 128));//设置背景为灰色
	cleardevice();//以背景颜色清空画布

	int center_x = 300, center_y = 300;//圆心坐标
	int radius = 200;//圆半径

	//圆外切矩形相关坐标
	int left, right, top, bottom;
	left = center_x - radius; right = center_x + radius;
	top = center_y - radius; bottom = center_y + radius;

	//for循环实现整个圆
	int i;
	float offset;
	for (i = 1; i <= 20; i++)
	{
		offset = i * PI / 10;
		setfillcolor(RGB(0, 240, 220));//设置填充颜色为青色
		solidpie(left, top, right, bottom, offset, 2 * PI / 60 + offset);//画填充扇形
		setfillcolor(RGB(255, 255, 255));//设置填充颜色为白色
		solidpie(left, top, right, bottom, 2 * PI / 60 + offset, 3 * PI / 60 + offset);//画填充扇形
		setfillcolor(RGB(200, 0, 0));//设置填充颜色为红色
		solidpie(left, top, right, bottom, 3 * PI / 60 + offset, 5 * PI / 60 + offset);//画填充扇形
		setfillcolor(RGB(0, 0, 0));//设置填充颜色为黑色
		solidpie(left, top, right, bottom, 5 * PI / 60 + offset, 6 * PI / 60 + offset);//画填充扇形
	}

	_getch();
	return 0;
}